package server.rpc;

import net.customware.gwt.dispatch.server.ActionHandler;
import net.customware.gwt.dispatch.server.ExecutionContext;
import net.customware.gwt.dispatch.shared.DispatchException;
import shared.rpc.ExampleAction;
import shared.rpc.ExampleResult;

/**
 * @author vinakov
 */

public class ExampleActionHandler implements ActionHandler<ExampleAction,ExampleResult> {

    public Class<ExampleAction> getActionType() {
        return ExampleAction.class;
    }

    public ExampleResult execute(ExampleAction exampleAction, ExecutionContext executionContext)
            throws DispatchException {
        ExampleResult result = new ExampleResult();
        result.setStatus("from server:"+ exampleAction.getWord());
        return result;
    }

    public void rollback(ExampleAction exampleAction, ExampleResult exampleResult,
            ExecutionContext executionContext) throws DispatchException {

    }
}
